<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <title>Title</title>
    <script src="js/jquery-3.2.1.min.js"></script>
    <!-- 运用ajax做的时钟效果 -->
    <script>
        function time() {
            $.ajax({
                type:'post',
                cache:false,
                url:'timerrrr',    <!-- 这个是调到Test.java里面的控制器timerrrr -->
                dataType:'text',
                success:function (d) {
                    $('h3:first').html(d);
                }
            });
        }

        $(function(){
            time();
            setInterval(time,1000);
          });
    </script>
</head>
<body>
<!-- 时钟显示时间区域 -->
<h3></h3>
<script>
    var d=new Date();
    d.setTime(1504782999834);
    document.write(d.toLocaleString());
</script>
</body>
</html>